package com.aspose.cells;

public class ConditionalFormattingResult {
   private zee a;

   ConditionalFormattingResult(zee cStyle) {
      this.a = cStyle;
   }

   public Style getConditionalStyle() {
      return this.a.a;
   }

   Style a() {
      Style var1 = this.a.b;
      if (this.getConditionalFormattingColorScale() != null) {
         if (var1.getPattern() != 0 && var1.getPattern() != 1) {
            var1.setBackgroundColor(this.getColorScaleResult());
         } else {
            var1.setPattern(1);
            var1.setForegroundColor(this.getColorScaleResult());
         }
      }

      return var1;
   }

   public ConditionalFormattingIcon getConditionalFormattingIcon() {
      if (this.a.c == null) {
         return null;
      } else {
         zail var1 = (zail)((zail)this.a.c.get("IconSetStyle"));
         if (var1 != null) {
            IconSet var2 = var1.a;
            int var3 = var2.getCfvos().getCount();
            int var4 = var1.a();
            if (var4 == -1) {
               return null;
            } else {
               if (var2.getType() == 21) {
                  if (var2.getReverse()) {
                     var4 = var3 - 1 - var4;
                  }
               } else if (!var2.getReverse()) {
                  var4 = var3 - 1 - var4;
               }

               int var5 = var1.a(var4);
               ConditionalFormattingIcon var6 = new ConditionalFormattingIcon();
               if (var2.getType() == 21) {
                  var6.setIndex(var3 - 1 - var2.getCfIcons().get(var4).getIndex());
               } else {
                  var6.setIndex(var4);
               }

               var6.setType(var5);
               return var6;
            }
         } else {
            return null;
         }
      }
   }

   public DataBar getConditionalFormattingDataBar() {
      if (this.a.c == null) {
         return null;
      } else {
         znn var1 = (znn)((znn)this.a.c.get("DataBarStyle"));
         if (var1 != null) {
            DataBar var2 = var1.a;
            return var2;
         } else {
            return null;
         }
      }
   }

   public ColorScale getConditionalFormattingColorScale() {
      if (this.a.c == null) {
         return null;
      } else {
         zki var1 = (zki)((zki)this.a.c.get("ColorScaledStyle"));
         if (var1 != null) {
            ColorScale var2 = var1.a;
            return var2;
         } else {
            return null;
         }
      }
   }

   public Color getColorScaleResult() {
      Color var1 = new Color();
      if (this.a.c == null) {
         return var1;
      } else {
         zki var2 = (zki)((zki)this.a.c.get("ColorScaledStyle"));
         if (var2 != null) {
            ColorScale var3 = var2.a;
            if (!var3.a()) {
               var1 = var2.a();
            } else {
               var1 = var2.b();
            }

            return var1;
         } else {
            return var1;
         }
      }
   }
}
